Hey, im trying to fix this error in my script and i cannot find it, please help me
local RS = game:GetService("ReplicatedStorage")
local function createEvent(eventName)
local event = game.ReplicatedStorage:FindFirstChild(eventName)
if not event then
event = Instance.new("RemoteEvent", game.ReplicatedStorage)
event.Name = eventName
end
return event
end
local buy= createEvent("BuyGCoil")
buy.OnServerEvent:Connect(function(player, price)
local points = player:FindFirstChild("leaderstats"):FindFirstChild("Points")
local item = RS:WaitForChild("Gravity Coil")
points.Value = points.Value - price
local clone = item:Clone()
local SPclone = item:Clone()
clone.Parent = player.Backpack
SPclone.Parent = player.StarterGear

2 comments
I don't see an end) at the end of the script to close the function.
I actually tried that before and it didnt work, now it does, please put that as an answer so i can give you reputation