I am new to making UI in Roblox studio and I am trying to make a ring from sonic. what is supposed to happen is that when you touch the ring it will fire a remote event that it will fire a remote event that will update the text label however when i touch the ring the " Argument 1 missing or nil" error message appears.
This is my script which is a child on the ring:
local ring = script.Parent
local ringSparkle = ring.ParticleEmitter
ringSparkle.Enabled = false
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ringUpdate = ReplicatedStorage:WaitForChild("ringCountUpdate")
function destroy(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChild("Humanoid")
if humanoid then
ring.Transparency = 1
ring.CanCollide = false
ringSparkle.Enabled = true
wait(1)
ring:Destroy()
ringUpdate:FireClient()
end
end
ring.Touched:Connect(destroy)
and this is my text label local script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ringUpdate = ReplicatedStorage:WaitForChild("ringCountUpdate")
local ringCount = script.Parent
local ringCountInt = 0
ringCount.Text = tostring(ringCountInt)
local function addRing ()
ringCountInt += 1
ringCount.Text = tostring(ringCountInt)
end
ringUpdate.OnClientEvent:Connect(addRing)
