Hello,
I’m trying to figure out how i could make a system whenever i press a button on my gui a part drops in front of my character (kinda like a drop system)
But i do not know how i could do this.
Thanks in advance for the help!
Hello,
I’m trying to figure out how i could make a system whenever i press a button on my gui a part drops in front of my character (kinda like a drop system)
But i do not know how i could do this.
Thanks in advance for the help!
When you click it un-anchors the part.
Like mousebutton1:fire or something idk im not a scripter
No, i mean like whenever you click the button it clones a part from Serverstorage and drops it in front of the player who clicked the button.
Then I don’t know how to help, sorry.
Local script in drop button
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.EVENT:FireServer()
end)
Server script in ServerScriptService
game.ReplicatedStorage.EVENT.OnServerEvent:Connect(function(player)
local part = game.ServerStorage:FindFirstChild("Your part"):Clone()
part.Parent = workspace
part.CFrame = player.Character.HumanoidRootPart.CFrame
print("Part dropped")
end)
^^^ This script is going to place it right where the humanoidrootpart of the player is. Using CFrame, you can position it specifically how you want it.
Instance.new(part) maybe and then it’s like unanchored and drips from a certain part?
Just edited it so it clones the part from server storage*
You could use a Remote event that fires when the player presses the button.
A server script will then use something like this:
local Part = game:GetService("ServerStorage").Part
local event = game:GetService("ReplicatedStorage").RemoteEvent -- the remote event must be in the replicated storage to work
event.OnServerEvent:Connect(function()
Part:Clone().Parent = workspace
end)
Thank you! This works perfectly.