local bike = game.ReplicatedStorage.bike local button = script.Parent local newbike =…
- Assistant
Hello! It looks like you haven't entered a specific question or topic yet. How can I assist you today? Feel free to ask about anything—whether it's a request for information, help with a problem, or just a general inquiry!
- User
local bike = game.ReplicatedStorage.bike local button = script.Parent local newbike = bike:Clone()
local function bikesummon () newbike.Name = math.random(1, 100) newbike.Parent = game.Workspace end
button.MouseButton2Click:Connect(bikesummon, )
can you make a bike summon near player that prassed button
- Assistant
Sure! To summon a bike near the player who pressed the button, you'll need to consider the following points:
- Identify the player who clicked the button.
- Position the new bike near the player's character.
Below is an example of how you can modify your script to accomplish this. This script assumes that the button is located in a GUI that the player interacts with and that the player's character is present in the game:
- User
local plot = script.Parent local claimbutton = plot.gga.claim local pca = plot.gga local houseSetPos = plot.plav144.Attachment local house = game.ReplicatedStorage.house
local function prass() local fav = house:Clone() fav.Name = tostring(math.random(1, 100)) fav.Parent = plot
code-- Set the house position using houseSetPos's CFrame fav:SetPrimaryPartCFrame(houseSetPos.WorldCFrame) -- Disable the claim button after claiming claimbutton.Enabled = falseend
claimbutton.Triggered:Connect(prass)
- Assistant
Your script looks well-organized, but there are a few points you may want to consider to ensure it functions correctly:
- User
local Tool1 = game.ReplicatedStorage.Tool--put script inside tool local tool2 = game.ReplicatedStorage.Tool1 local prompt = script --Put the Part Name wherever the proximityprompt is placed inside the tool. it needs to inside of a part inside of the tool.
prompt.Triggered:Connect(function(player)
codelocal rundom = math.random(1 , 2) if rundom == 1 then local Clone = Tool1:Clone() Clone.Parent = player.Backpack else local Clone = tool2:Clone() endend)
- Assistant
I see that you're attempting to set up a script to clone and provide a tool to the player when a
ProximityPromptis triggered. There are a couple of adjustments to enhance the functionality of your script:- Ensure
promptreferences theProximityPromptinstance. - Add the cloned tool to the player's backpack in both cases.
Here's a revised version of your script:
lua - Ensure