local db = false
local Prize = script.Parent.Parent.Info.Prize

script.Parent.Touched:Connect(function(hit)
	if db == false then
		db = true
		if hit.Parent:FindFirstChild("Humanoid") then
			print("Found a player")
			local player = game.Players:GetPlayerFromCharacter(hit.Parent)
			player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + Prize.Value
			player.DoingObby.Value = false
			game.Workspace.Sounds.Success_Sound:Play()
			game.ReplicatedStorage.ObbyMapRewardNotification.WinNotification:FireAllClients(Prize.Value,script.Parent.Parent.Info.Prize.CurrencyName.Value, script.Parent.Parent.Name)
			hit.Parent.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.Spawn.SpawnPoint.SpawnLocation.Position + Vector3.new(0,7,0))
			game.ReplicatedStorage.ObbyMapRewardNotification.RewardNotification:FireClient(player,Prize.Value,script.Parent.Parent.Info.Prize.CurrencyName.Value, script.Parent.Parent.Name)
			game.ReplicatedStorage.ObbyLockEvents.Lock:FireClient(player)
			wait(0.5)
			db = false
		end
	end
end)

2 comments

0

If you don't know where the code is, it is " game.ReplicatedStorage.ObbyMapRewardNotification.WinNotification:FireAllClients(Prize.Value,script.Parent.Parent.Info.Prize.CurrencyName.Value, script.Parent.Parent.Name)"

0

Error must be in local script, as FireAllClients cannot just affect one client. Show us your local script.