RemoteEvents
RemoteEvents can help you on functions that can't be interacted with from different areas. For example, you might've tried using a script but the change wouldn't show. That's because you can't just interact with stuff from everywhere. You can make a server script and a client script work together to do what you want.
Here's an example:
Server script:
game.ReplicatedStorage.RemoteEvent:FireAllClients() or game.ReplicatedStorage.RemoteEvent:FireClient(plr)
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect:function()
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)
end)
Client script:
game.ReplicatedStorage.RemoteEvent:FireServer()
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect:function()
local tool = game.ReplicatedStorage.Tool:Clone()
tool.Parent = game.Players.LocalPlayer.Backpack
tool.Name = "YourCustomName"
end)
These scripts will work together to turn a part into a killbrick and give the player a tool with a name of your choice.
Create Your Own Website With Webador