Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local dialog = script.Parent
- dialog.DialogChoiceSelected:connect(function(player, choice)
- -- Check the player has a stats object
- local stats = player:FindFirstChild('leaderstats')
- if not stats then return end
- -- And that the stats object contains a gold member
- local Points = stats:FindFirstChild('Points')
- if not Points then return end
- if choice == script.Parent.DialogChoice.ChoiceA then
- if Points.Value >= 100 then -- 5 is the amount of gold you need to purchase this weapon
- game.ReplicatedStorage.InvisibleLegs:Clone().Parent = player.Character
- Points.Value = Points.Value - 100 -- subtract the amount of gold you need to purchase
- wait(3)
- chats = {"That will be 100 Points please!"}
- game:GetService("Chat"):Chat(script.Parent.Parent.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Green)
- else
- chats = {"Insufficent Funds!"}
- wait(3)
- game:GetService("Chat"):Chat(script.Parent.Parent.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Red)
- end
- elseif choice == dialog.DialogChoice.ChoiceB then
- if Points.Value >= 150 then
- game.Lighting.InvisibleArms:Clone().Parent = player.Character
- Points.Value = Points.Value - 150
- wait(3)
- chats = {"That will be 150 Points please!"}
- game:GetService("Chat"):Chat(script.Parent.Parent.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Green)
- else
- chats = {"Insufficent Funds!"}
- wait(3)
- game:GetService("Chat"):Chat(script.Parent.Parent.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Red)
- end
- elseif choice == dialog.DialogChoice.ChoiceC then
- if Points.Value >= 200 then
- game.ReplicatedStorage.InvisibleTorso:Clone().Parent = player.Character
- Points.Value = Points.Value - 200
- wait(3)
- chats = {"That will be 200 Points please!"}
- game:GetService("Chat"):Chat(script.Parent.Parent.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Green)
- else
- chats = {"Insufficent Funds!"}
- wait(3)
- game:GetService("Chat"):Chat(script.Parent.Parent.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Red)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement