Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Local Script
- local BadgeRequirement = script.Parent.BadgeRequirement
- local function OnBadgeAwarded(player, badgeId)
- if badgeId == BadgeRequirement.Value then
- script.Parent:FireServer("ToolGiver")
- end
- end
- game.Players.PlayerAdded:Connect(function(player)
- player.BadgeAwarded:Connect(OnBadgeAwarded)
- end)
- --Script
- local BadgeRequirement = script.Parent.BadgeRequirement
- function OnBadgeAwarded(player, badgeId)
- if badgeId == BadgeRequirement.Value then
- script.Parent:FireServer("ToolGiver")
- end
- end
- game.Players.PlayerAdded:Connect(function(player)
- player.BadgeAwarded:Connect(OnBadgeAwarded)
- end)
- --RemoteEvent
- local BadgeRequirement = script.Parent.BadgeRequirement
- local ToolGiverEvent = Instance.new("RemoteEvent")
- ToolGiverEvent.Name = "ToolGiverEvent"
- ToolGiverEvent.Parent = script.Parent
- function OnBadgeAwarded(player, badgeId)
- if badgeId == BadgeRequirement.Value then
- ToolGiverEvent:FireClient(player, "ToolGiver")
- end
- end
- game.Players.PlayerAdded:Connect(function(player)
- player.BadgeAwarded:Connect(OnBadgeAwarded)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement