In my case, you push a part onto a part then when it's touched the part you get points every, lets say, 0.2 seconds. However, i'm not sure this is possible due to it saying you cant fire an event because its not client side or something. Answers appreciated, Fxi.
✓ ANSWER ACCEPTED
How would i go about making a part give points on touch of another part?
1 answer
✓ Accepted answer
-- [[Server Side]] --
game.Players.PlayerAdded:Connect(function(plr)
local ls = Instance.new("Model")
ls.Name = "leaderstats"
ls.Parent = plr
local m = Instance.new("IntValue", ls)
m.Name = "Points"
m.Value = 0
end)
--[[Server Side]] --
-- Make sure to put this inside a brick named TouchMe
local TouchMe = script.Parent
TouchMe.TouchMe.Touched:Connect(function(hit)
local Points = game.Players:FindFirstChild(hit.Parent.Name):WaitForChild("leaderstats").Points
Points.Value = Points.Value + 1
wait(2)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
